package com.ybu.controller;

import com.ybu.common.R;
import com.ybu.pojo.vo.ProductVO;
import com.ybu.service.ProductService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("api/product")
public class ProductController {
    @Autowired
    private ProductService productService;
@GetMapping("newList")
    public R<List<ProductVO>> getProductList(){
    List<ProductVO> productList=productService.getProductList();
    return R.ok(productList);
}
}
